package org.smr.ministore.micro.client;

import java.util.List;

import org.blade.utils.Pager;
import org.smr.ministore.entities.Address;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@FeignClient("gateway.Address")
public interface FeignAddressMicroServiceClient {

    @RequestMapping(method = RequestMethod.PUT, value = "/Address/batchSave")
    int batchSave(@RequestBody List< Address> entities);

    @RequestMapping(method = RequestMethod.POST, value = "/Address/batchModify")
    int batchModify(@RequestBody List< Address> entities);

    @RequestMapping(method = RequestMethod.PUT, value = "/Address/save")
    public int save(@RequestBody Address entity) ;

    @RequestMapping(method = RequestMethod.PATCH, value = "/Address/updateById")
    public int updateById(@RequestBody Address id);

    @RequestMapping(method = RequestMethod.GET, value = "/Address/queryById/{id}")
    public  Address queryById(@PathVariable("id")Long id);

    @RequestMapping(method = RequestMethod.DELETE, value = "/Address/deleteById/{id}")
    public int deleteById(@PathVariable("id")Long id);

    @RequestMapping(method = RequestMethod.POST, value = "/Address/paginate")
    public Pager<Address> paginate( @RequestBody Address entity, Long pageSize, Long pageNum);
}
